package system

import (
	"context"

	"go_admin/api/system/v1"
	"go_admin/internal/service"
)

func (c *ControllerV1) ConfigList(ctx context.Context, req *v1.ConfigListReq) (res *v1.ConfigListRes, err error) {
	res, err = service.SysConfig().List(ctx, req)
	return
}
func (c *ControllerV1) ConfigAdd(ctx context.Context, req *v1.ConfigAddReq) (res *v1.ConfigAddRes, err error) {
	err = service.SysConfig().Add(ctx, req, service.Context().GetUserId(ctx))
	return
}
func (c *ControllerV1) ConfigGet(ctx context.Context, req *v1.ConfigGetReq) (res *v1.ConfigGetRes, err error) {
	res, err = service.SysConfig().Get(ctx, req.Id)
	return
}
func (c *ControllerV1) ConfigEdit(ctx context.Context, req *v1.ConfigEditReq) (res *v1.ConfigEditRes, err error) {
	err = service.SysConfig().Edit(ctx, req, service.Context().GetUserId(ctx))
	return
}
func (c *ControllerV1) ConfigDelete(ctx context.Context, req *v1.ConfigDeleteReq) (res *v1.ConfigDeleteRes, err error) {
	err = service.SysConfig().Delete(ctx, req.Ids)
	return
}
